package org.tof.hotel.entity;

import org.tof.hotel.entity.Room;

import java.util.ArrayList;
import java.util.Date;

/** This class stores all the needed info about room's booking. */
public class Booking {
    public Booking(Room room, Date beginDate, Date endDate) {
        setRoom(room);
        setBeginDate(beginDate);
        setEndDate(endDate);
        bookings.add(this);
    }
    // -----fields----- //
    private Room room;
    private Date beginDate;
    private Date endDate;

    static private ArrayList<Booking> bookings = new ArrayList<Booking>();

    // -----getters & setters----- //

    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
    // -----methods----- //

    /**
     * Checks if the room is not booked
     *
     * @return <code>true</code> if room is available; otherwise - <code>false</code>
     */
    public static boolean isNotBooked(Room room, Date beginDate, Date endDate) {
        // TODO implement
        return true;
    }
}